<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Agp\CoreBundle\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\DependencyInjection\Container;
use JMS\DiExtraBundle\Annotation\Validator;
use JMS\DiExtraBundle\Annotation\InjectParams;
use JMS\DiExtraBundle\Annotation\Inject;

/**
 * Description of SomenteNumeroValidator
 *
 * @author bondcs
 */
class SomenteNumeroValidator extends ConstraintValidator {

    public function validate($value, Constraint $constraint) {
        if (!preg_match('/^[0-9]+$/', $value) AND $value != ""){
            $this->context->addViolation($constraint->message);
        }
    }
}

?>
